package com.kushuigu.controller;

import com.kushuigu.domain.House;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/houses")
public class HouseController {
    @GetMapping
    public String getAll() {
        System.out.println("house getAll");
        return "{'module':'house getAll'}";
    }

    @GetMapping("/{id}")
    public String getById( @PathVariable Integer id) {
        System.out.println("house getById" + id);
        return "{'module':'house getById'}";
    }

    @PostMapping
    public String save(@RequestBody House house) {
        System.out.println("save"+house);
        return "{'module':'house save'}";
    }

    @PutMapping
    public String update(@RequestBody House house) {
        System.out.println("house update");
        return "{'module':'house update'}";
    }

    @DeleteMapping("/{id}")
    public String delete(@PathVariable Integer id){
        System.out.println("delete"+id);
        return "{'module':'house delete'}";
    }
}
